home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / answrbok / 3_17.lha / 3_17 / 3_17a.c next >
C/C++ Source or Header  |  1993-08-08  |  485b  |  35 lines

  1. * Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
  2. * The C++ Answer Book */
  3. * Tony Hansen */
  4. * All rights reserved. */
  5. / Example 1 of indentation styles
  6. / Kernighan-Ritchie style
  7. include <stdio.h>
  8. nt main(int, char**)
  9.  
  10.    int a;
  11.    for (a = 0; a < 4; ) {
  12. a++;
  13.    }
  14.  
  15.    if (a > 1) {
  16. printf(">1");
  17.    } else {
  18. printf("<2");
  19.    }
  20.  
  21.    switch (a) {
  22.    case 3:
  23. printf("3");
  24. break;
  25.  
  26.    default:
  27. printf("!=3");
  28. break;
  29.    }
  30.  
  31.    do {
  32. printf("DW");
  33.    } while (a++ < 8);
  34.  
  35.